package com.jman.reply.controller;

import com.jman.reply.domain.Reply;
import com.jman.reply.dto.ReplyToUser;
import com.jman.reply.service.impl.ReplyServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/reply")
public class ReplyController {
    @Resource
    private ReplyServiceImpl replyService;

    @GetMapping("/getInfo")
    public List<ReplyToUser> getReply(@RequestParam("id") Long id){
        return replyService.getReply(id);
    }

    @PostMapping("/saveInfo")
    public Boolean sendReply(@RequestBody Reply reply){
        return replyService.save(reply);
    }
}
